﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Text;
using Xyz.Core.Data.Configurations;
using Xyz.Core.Data.Entity;

namespace Xyz.Core.Data
{
   public class FlightContext : DbContext
    {

        /// <summary>
        /// FlightContext
        /// </summary>
        public FlightContext(DbContextOptions<FlightContext> options) :
            base(options)
        {
        }
        /// <summary>
        /// OnModelCreating
        /// </summary>
        /// <param name="modelBuilder"></param>
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            modelBuilder.ApplyConfiguration(new HbxxConfiguration());
            modelBuilder.ApplyConfiguration(new IcaoConfiguration());

            modelBuilder.ApplyConfiguration(new AcConfiguration());
            modelBuilder.ApplyConfiguration(new TypeserverConfiguration());
        }



        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            base.OnConfiguring(optionsBuilder);
        }

        #region DbSets
        public DbSet<Hbxx> Hbxxs { get; set; }
        public DbSet<Icao> Icaos { get; set; }

        public DbSet<Ac> Acs { get; set; }
        public DbSet<Typeserver> Typeservers { get; set; }
        #endregion
    }
}
